package com.gaoyuzhe.controller;

import com.gaoyuzhe.to.ReturnValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class OrderController {
    private static String PAYMENT_URL = "http://consul-provider-payment/payment";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/consul")
    public ReturnValue<String> paymentConsul() {
        return restTemplate.getForObject(PAYMENT_URL+"/consul/",ReturnValue.class);

    }
}
